#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QHBoxLayout>
#include <QtGui>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    showWeb(ui->page_2);
	//showVideo(ui->page);
}

MainWindow::~MainWindow()
{
    delete ui;
}
void MainWindow::showWeb(QWebEngineView* view)
{
	QString strTest = "http://baidu.com";
	//QString strMapPath("file:///E:/College/Code/QT/workspace/UAV_Frame/debug/map.html");
	QString  strMapPath = "file:///";
	strMapPath += QCoreApplication::applicationDirPath();
	strMapPath += "/map.html";
	view->setUrl(QUrl(strMapPath));
	view->resize(1024, 750);
	view->show();
}
void MainWindow::showVideo(QMediaPlayer *player)
{
	//QMediaPlayer *player = new QMediaPlayer;
	QString videoPath = "F:/QQDownload/Dangal (2016) 720p Desi pDvD Rip - x264 AC3 (Line Audio) - ESub - DUS.mkv";
	player->setMedia(QUrl::fromLocalFile(videoPath));
	QVideoWidget *widget = new QVideoWidget;
	player->setVideoOutput(widget);
	widget->show();
	player->play();
}